package com.msmall.community.common.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.msmall.base.model.BaseObject;

/**
 * 系统消息
 * 包括：
 * 1，好友请求消息 ConstantDB.MESSAGE_TYPES_FRIEND
 * 存放格式：content:请求时的内容 senderid:请求者 receiver:接受者 status：ConstantDB.UNREAND title:ConstantDB.MESSAGE_CONTENT_FRIEND
 * 2，邀请用户 ConstantDB.MESSAGE_TYPES_TEAM_INVITE
 * 存放格式：content:teamid senderid:发送者 receiver:接受者 status：ConstantDB.UNREAND title:ConstantDB.MESSAGE_TITLE_TEAM_INVITE
 * @author zhzy
 *
 */
@Entity
@Table(name="base_message")
public class Message extends BaseObject {

	private static final long serialVersionUID = -6982304957479916679L;

	@Id
	@Column(name="messageid")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long messageid;

	@Column(name="sender")
	private Long sender;

	@Column(name="receiver")
	private Long receiver;

	@Column(name="title")
	private String title;

	@Column(name="content")
	private String content;

	/**
	 * 是否阅读了
	 */
	@Column(name="status")
	private Short status;
	/**
	 * 消息类型：ConstantDB.MESSAGE_TYPES_
	 * 1：好友请求
	 */
	@Column(name="types")
	private Integer types;
	
	@Column(name="create_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	
	public Message() {
		super();
	}

	public Long getMessageid() {
		return messageid;
	}

	public void setMessageid(Long messageid) {
		this.messageid = messageid;
	}

	public Long getSender() {
		return sender;
	}

	public void setSender(Long sender) {
		this.sender = sender;
	}

	public Long getReceiver() {
		return receiver;
	}

	public void setReceiver(Long receiver) {
		this.receiver = receiver;
	}

	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getTypes() {
		return types;
	}

	public void setTypes(Integer types) {
		this.types = types;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}
